#ifndef BSP_INC_BSP_MOTOR_H_
#define BSP_INC_BSP_MOTOR_H_
#include "Mini58Series.h"

// A： Dir P32 EN P31
#define MOT_PWM_A_CYCLE 800
#define MOT_PWM_A_MIN 100
#define MOT_PWM_A_MAX 1500

#define MOT_EN_A_PIN P31
#define MOT_EN_A_GPIO P3
#define MOT_EN_A_IO BIT1

#define MOT_DIR_A_PIN P32
#define MOT_DIR_A_GPIO P3
#define MOT_DIR_A_IO BIT2

// B： Dir P35 EN P34
#define MOT_PWM_B_CYCLE 160

#define MOT_PWM_B_MIN 0
#define MOT_PWM_B_MAX 500

#define MOT_EN_B_PIN P34
#define MOT_EN_B_GPIO P3
#define MOT_EN_B_IO BIT4

#define MOT_DIR_B_PIN P35
#define MOT_DIR_B_GPIO P3
#define MOT_DIR_B_IO BIT5

// C： Dir P51 EN P36
#define MOT_PWM_C_CYCLE 1500
#define MOT_PWM_C_MIN 500
#define MOT_PWM_C_MAX 2500

#define MOT_EN_C_PIN P36
#define MOT_EN_C_GPIO P3
#define MOT_EN_C_IO BIT6

#define MOT_DIR_C_PIN P51
#define MOT_DIR_C_GPIO P5
#define MOT_DIR_C_IO BIT1

//FAN
#define FAN_PIN P14
#define FAN_GPIO P1
#define FAN_IO BIT4

typedef enum{
  MOT_GN_A = 0,
  MOT_GN_B,
  MOT_GN_C,
}MOT_GN_E;

void bsp_motor_Init(void);
void bsp_mot_set(MOT_GN_E gn, uint8_t dir, uint8_t en);
void bsp_mot_set_step(MOT_GN_E gn, uint8_t step_value);
void bsp_fan_set(uint8_t sta);
#endif /* BSP_INC_BSP_LIGHT_H_ */
